package com.buba.goods.pojo;

import lombok.Data;

import java.io.Serializable;

@Data
public class MatterInfo implements Comparable<MatterInfo>, Serializable {
    private String itemsInfoNo;
    private String itemsName;
    private String itemsAddress;
    private String itemsScale;
    private Integer itemsCounts;
    private String itemsOrderNo;
    private String itemsAddNo;
    private String itemsTtranNo;
    private String itemsInStoreNo;
    //货物种类id 和name
    private String itemsTypeId;
    private String itemsTypeName;

    @Override
    public int compareTo(MatterInfo o) {
        //如何重写方法
        //按年龄升序排序比较
        //this(当前调用方法的对象)   o(参数传入)
        //所有比较最底层的逻辑都是发生两两比较逻辑的,返回比较结果
        //只关心结果结果三种:
        //正数:   this.age - o.age    >
        //负数:   this.age - o.age    <
        //0       this   ==


        return o.itemsCounts-this.itemsCounts; //降序
//        return o.age-this.age; 降序排序
        //按照名字字符串长度升序排序
//        return this.name.length()-o.name.length();
    }
}
